{extend name="layout:base" /}

{block name="content"}
<div class="layui-fluid">
    <div class="layui-card">
        <form class="layui-form">

            <div class="layui-card-header">代理商关键词底价</div>
            <div class="layui-card-body layui-text">
                <input type="hidden" id="id" name="id" value="{$article.id}">
                <div class="layui-row  layui-form-item">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">百度：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="baidu" autocomplete="off" class="layui-input"
                                   value="{$article.baidu}">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">百度移动：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="baiduM" autocomplete="off" class="layui-input"
                                   value="{$article.baiduM}">
                        </div>
                    </div>
                </div>
                <div class="layui-row  layui-form-item">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">360：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="so" autocomplete="off" class="layui-input" value="{$article.so}">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">360移动：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="soM" autocomplete="off" class="layui-input" value="{$article.soM}">
                        </div>
                    </div>
                </div>
                <div class="layui-row  layui-form-item">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">搜狗：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="sougou" autocomplete="off" class="layui-input"
                                   value="{$article.sougou}">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">搜狗移动：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="sougouM" autocomplete="off" class="layui-input"
                                   value="{$article.sougouM}">
                        </div>
                    </div>
                </div>
                <div class="layui-row  layui-form-item">
                    <label class="layui-form-label">神马：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="shenma" autocomplete="off" class="layui-input"
                               value="{$article.shenma}">
                    </div>
                </div>

                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button class="layui-btn" lay-submit="" lay-filter="btnSave">保存</button>
                            <a class="layui-btn layui-btn-primary" href="javascript:parent.location.reload();">返回</a>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}

{block name="script"}
<script>

    layui.config({
        base: '__STATIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: '/lib/index' //主入口模块
    }).use(['index', 'table', 'form', 'laydate'], function () {
        var $ = layui.$, form = layui.form, layer = layui.layer, table = layui.table, laydate = layui.laydate;

        laydate.render({elem: '#serviceEndTime'});

        form.on('submit(btnSave)', function (data) {
            $.post("{:url('config')}", data.field, function (result) {
                console.log(result);
                if (result['code'] == 0) {
                    layer.msg(result['msg'], {icon: 1, time: 1000}, function () {
                        location.reload();
                    });
                } else {
                    layer.msg(result['msg'], {icon: 3, time: 3000});
                }
            });
            return false;
        });


    });
</script>
{/block}